package org.tea.inventory.domain.tea;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.tea.inventory.base.validation.groups.warehouse.OutGroup;
import org.tea.inventory.base.validation.groups.warehouse.SwapGroup;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 库存流水对应信息对象 warehouse_inventory_serial_info
 * 
 * @author dongxb
 * @date 2025-04-16
 */
@ApiModel(value = "库存流水对应信息对象")
@Data
@NoArgsConstructor
public class WarehouseInventorySerialInfo implements Serializable
{
    private static final long serialVersionUID = 1L;

    /** 主键 */
    private Long id;

    /** 流水对应信息id */
    @ApiModelProperty(name = "流水对应信息id")
    private Long serialInfoId;

    /** 商品id */
    @ApiModelProperty(name = "商品id")
    private Long productId;

    /** 商品编号 */
    @ApiModelProperty(name = "商品编号")
    private String productCode;

    /** 商品名称 */
    @ApiModelProperty(name = "商品名称")
    private String productName;

    /** 流水表id */
    @ApiModelProperty(name = "流水表id")
    private Long serialId;

    /** 交易开始时剩余库存量 */
    @ApiModelProperty(name = "交易开始时剩余库存量")
    private Long createProductNumber;

    /** 本次更新数量 */
    @ApiModelProperty(name = "本次更新数量")
    private Long updateNumber;

    /** 本次更新类型 1入库，2出库 */
    @ApiModelProperty(name = "本次更新类型 1入库，2出库")
    private String updateType;

    /** 是否删除：0未删除，1已删除 */
    @ApiModelProperty(value = "是否删除： 0未删除，1已删除")
    private Integer delFlag;

    /** 交易开始时单价 */
    @ApiModelProperty(name = "交易开始时单价")
    private BigDecimal createPrice;

    /** 卖出单价 */
    @ApiModelProperty(name = "卖出单价")
    private BigDecimal sellPrice;

    /** 交易开始时合计价格 */
    @ApiModelProperty(name = "交易开始时合计价格")
    private BigDecimal sumPrice;

    /** 备注 */
    //@NotBlank(message = "备注不能为空" , groups = {OutGroup.class , SwapGroup.class})
    @ApiModelProperty(name = "备注")
    private String remarks;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(name = "创建时间")
    private Date createDate;

    /** 创建者 */
    @ApiModelProperty(name = "创建者")
    private String createUserId;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(name = "更新时间")
    private Date updateDate;

    /** 更新者 */
    @ApiModelProperty(name = "更新者")
    private String updateUserId;

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("serialInfoId", getSerialInfoId())
            .append("productId", getProductId())
            .append("serialId", getSerialId())
            .append("createProductNumber", getCreateProductNumber())
            .append("updateNumber", getUpdateNumber())
            .append("updateType", getUpdateType())
            .append("createPrice", getCreatePrice())
            .append("sellPrice", getSellPrice())
            .append("sumPrice", getSumPrice())
            .append("remarks", getRemarks())
            .append("createDate", getCreateDate())
            .append("createUserId", getCreateUserId())
            .append("updateDate", getUpdateDate())
            .append("updateUserId", getUpdateUserId())
            .toString();
    }
}
